#include<stdio.h>
#include<stdlib.h>

int un_gval;
int init_gval = 100;

int main(int argc, char *argv[], char *env[])
 {
     printf("code addr: %p\n", main);
     char *str = "Hello, Linux!";
     *str = 'S';
     printf("read only char addr: %p\n", str);
     printf("init global value addr: %p\n", &init_gval);
     printf("uninit global value addr: %p\n", &un_gval);
 
     char *heap1=(char*)malloc(100);
     char *heap2=(char*)malloc(100);
     char *heap3=(char*)malloc(100);
     char *heap4=(char*)malloc(100);
 
     int a = 100;

     printf("heap1 addr: %p\n", heap1);
     printf("heap2 addr: %p\n", heap2);
     printf("heap3 addr: %p\n", heap3);
     printf("heap4 addr: %p\n", heap4);
 
     printf("stack addr: %p\n", &str);
     printf("stack addr: %p\n", &heap1);
     printf("stack addr: %p\n", &heap2);
     printf("stack addr: %p\n", &heap3);
     printf("stack addr: %p\n", &heap4);                                                                                                                                              
     printf("a addr: %p\n",&a);
 
     int i = 0;
     for(i = 0; argv[i]; i++)
     {
         printf("argv[%d]: %p\n", i, argv[i]);
     }
     for(i = 0; env[i]; i++)
     {
         printf("env[%d]: %p\n", i, env[i]);
     }
     return 0;
 }
